<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:c="http://java.sun.com/jsp/jstl/core"
          xmlns:fn="http://java.sun.com/jsp/jstl/functions"
          xmlns:x="http://java.sun.com/jsp/jstl/xml"
          xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
          xmlns:html="http://struts.apache.org/tags-html" version="2.0">

    <jsp:directive.page contentType="text/xml;charset=UTF-8" pageEncoding="UTF-8"/>  

    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          output-encoding="UTF-8"
          title="Demo Tactile | by Isak Rabin" 
          xsi:noNamespaceSchemaLocation="http://www.netbiscuits.com/schema/netbiscuits-tactile.xsd">



        <c:set var="videoCount" value="${0}"/>
        <c:forEach var="videoItem" items="${requestScope['videoList']}" begin="0" varStatus="status">
            <c:set var="showVideo" value="${false}"/>

            <c:if test="${not empty videoItem and not empty videoItem.thumbnails[1] and not empty videoItem.thumbnails[1].url and (videoCount lt 5)}">
                <c:set var="showVideo" value="${true}"/>
            </c:if>

            <c:if test="${showVideo}">
                <view id="left-view-content-${videoCount +1}">

                    <container id="videoContainer">
                        <column>                                            
                            <TEXT>
                                <headline>${videoItem.title}</headline>
                                <richtext/>
                            </TEXT>

                            <IMAGE>
                                <img convert="true" format="PNG" src="${videoItem.thumbnails[1].url}" id="thumbnail" />  
                            </IMAGE>

                            <TEXT>
                                <headline/>
                                <text>${videoItem.summary}</text>
                            </TEXT>
                        </column>
                    </container>
                </view>     

                <c:set var="videoCount" value="${videoCount +1}"/>
            </c:if>

        </c:forEach>    

    </page>    
</jsp:root>                        